package com.sec.etech.bpm.cust.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sec.etech.bpm.cust.model.TaskOpinionCommunicate;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TaskOpinionCommunicateMapper extends BaseMapper<TaskOpinionCommunicate> {
    @Select("SELECT\n" +
            "\ta.communicate_id,\n" +
            "\ta.parent_instance_id,\n" +
            "\ta.parent_task_id,\n" +
            "\ta.bpm_inst_id,\n" +
            "\tb.* \n" +
            "FROM\n" +
            "\t`bpm_communicate` AS a\n" +
            "\tLEFT JOIN bpm_task_opinion AS b ON a.bpm_inst_id = b.inst_id_ \n" +
            "WHERE\n" +
            "\ta.active = 1 \n" +
            "\tAND b.task_id_ <> '0' \n" +
            "\tAND a.parent_instance_id = '${parentInstanceId}'")
    public List<TaskOpinionCommunicate> getTaskOpinionCommunicate(@Param("parentInstanceId") String parentInstanceId);


}
